=================================================================================
PicoMite V5.07.07 Changes from V5.07.06
INSTALLING THIS VERSION ERASES ALL FLASH SLOTS AND THE FLASH DISK

Breaking changes all versions
Number of flash slots reduced to 4

Breaking changes PicoMiteVGA
Tiles are now 8 pixels wide and not 16. The default tile height is 12 pixels to match font 1

New version WebMite for the Pico_W
See the WebMite manual for details

General changes - all versions
Updates SDK to V1.5
Updates Compiler to version 12.2.1
Support for MCP4822 DAC (8 pin version) for audio output
The LIBRARY commands, LIBRARY SAVE, LIBRARY DELETE and LIBRARY LIST are implemented with the same functionality as the Micromites.
Implements PLAY FLAC - same as PLAY WAV but for FLAC files
Improved performance of PLAY SOUND when left and right channels are the same
New parameter for OPTION SYSTEM I2C: OPTION SYSTEM I2C sdapin, sclpin [,SLOW/FAST]
Adds support for 128x128 ST7735S display from Waveshare (not VGA version)
Support for MM.CMDLINE$ 
Implements OPTION ESCAPE. This enables escape sequences in strings 
Enhancements to PLAY SOUND to remove clicks and pops
New "display" drivers VIRTUAL_C and VIRTUAL_M (not VGA version)
Support for i2c keyboard https://shop.pimoroni.com/products/bbq20-keyboard-with-trackpad-usb-i2c-pmod
LOAD IMAGE has also been enhanced to support 16-colour BMP files with run length encoded data.
Wildcards for copy and kill commands
Added capability for inverted serial signals - use 'inv' in the OPEN command
At the command prompt ONLY you can now use A: or B: to switch disk as well as DRIVE "A:" and DRIVE "B:" 

New/changed Commands - all versions
New command SYNC
SPRITE SHOW (SAFE) can now optionally show BLACK by setting bit 2 in the option parameter
PIO INTERRUPT pio, sm [,RXinterrupt] [,TXinterrupt]
PIO MAKE RING BUFFER
PIO DMA RX
PIO DMA TX
PIO ASSEMBLE
TILE HEIGHT n (VGA only)
SAVE COMPRESSED IMAGE (VGA only)
AUTOSAVE APPEND 
PLAY SOUND chan, M, waveform, freq [,vol]
PLAY SOUND LOAD array%()
PLAY SOUND chan, chan, U, freq [,vol]: support for user loadable profiles
PLAY SOUND LOAD array%()
PWM channel, frequency, [dutyA] [,dutyB] [,phase] [,deferredstart]
PWM SYNC [channel0offset] [,channel1offset] .......[channel7offset]

New/changed Functions - all versions
MM.INFO(EXISTS FILE fname$)
MM.INFO(EXISTS DIR dname$)r details
MM.INFO(PIO RX DMA)
MM.INFO(PIO TX DMA)
PIO(DMA RX POINTER)
PIO(DMA TX POINTER)
PIO(FLEVEL pio [,sm, DIR]) ' dir can be RX or TX. If specified gives the level of the specific fifo
PIO (SHIFTCTRL push_threshold [,pull_threshold] [,autopush] [,autopull] [,in_shiftdir] [,out_shiftdir] [,FJOIN_RX] [,FJOIN_TX])
peek(bp n%) ' returns the byte at address n% and increments n% to point to the next byte
peek(sp n%) ' returns the short at address n% and increments n% to point to the next short
peek(wp n%) ' returns the word at address n% and increments n% to point to the next word

Bug Fixes and corrections - all versions
Bug fix to ON ERROR SKIP
Bug fix to CHDIR for flash file system
Bug fix to PIO INTERRUPT not accepting 0 for TX interrupt
Numerous small bug fixes in file handling edge conditions
Fixes bug in use of SETPIN PWM on pins 19 and 20.
Fixes bug in SETPIN
Bug fix to LOAD JPG
Error now generated by  CAT/INC command when arrays exceed 255
Fixed bug in Triangle command not drawing border and fill in correct colours
Bug fixes for various numeric overflow conditions which now produce an error
Fixes bug in PLAY SOUND when switching from B to L or R
Fixes bug in PIO functions when in-built functions are used as arguments

=================================================================================
PicoMite V5.07.06 Changes from V5.07.04

Breaking changes PicoMite
PAGE command removed - replaced by GUI PAGE
GUI TEXTBOX ACTIVATE removed
Reduced available RAM and program size from 120KB to 116KB
Removes support for the GDEH029A1 display as this controller is now obsolete

Breaking changes PicoMiteVGA
Reduced available RAM and program size from 108KB to 100KB

General changes - both versions
Various tuning and performance improvements
Updates SDK to V1.4
Updates Compiler to version 11.2.1
Enables operation up to 378MHz
SETPIN for PWM no longer needs to specify the channel and port e.g. "SETPIN 1,PWM" is now accepted
Re-engineering of PORT command to allow simultaneous update
Modifies the port function to read all pins simultaneously
Revised version of CSub header to cater for compiler change
Updated CSUB header file and additional functions exposed
The number of flash slots in both versions is now 5
Changes the priority of the CIN.FIN,PER interrupt to improve accuracy
Resets default fonts when a new program is loaded or the NEW command is executed.
Max editor clipboard size now 16384 characters
Max number of BLIT buffers now 32 (memory dependent)
Support for file system on the Pico's flash. All SD file commands are supported. Flash drive is "A:" SDcard if configured is drive "B:"
By default the system restarts with the active drive as drive "A:" even if the SDcard is configured
On first installation the firmware will automatically create the flash drive. The firmware reads the size of the flash
and uses this to determine the drive size. Flash chips > 2Mb are fully supported
OPTION LIST now shows version number and which firmware
Changes to better support modules with >2Mb Flash chips
PWM duty cycles can now be negative which will invert the output (-100.0 <= duty <=100.0)


New/changed Commands - both versions
DRIVE drive$ - sets the active drive
DRIVE "A:/FORMAT" - re-initialise the flash drive
MATH RANDOMIZE [n] - seeds the  Mersenne Twister algorithm. 
TRIANGLE SAVE [#]n, x1,y1,x2,y2,x3,y3 - saves a triangular area of the screen to buffer #n.
TRIANGLE RESTORE [#]n - restores a saved triangular region of the screen and deletes the saved buffer.
MEMORY PACK source%(),Destination%(), number, size - packs the contects of one array into another
MEMORY UNPACK source%(), Destination%(), number, size - unpacks the content of one array from another
BITBANG SERIALTX pinno, baudrate, ostring$ - transmits ostring$ on pinno 
BITBANG SERIALRX pinno, baudrate, istring$, timeout_in_ms, status% [,nbr] [,terminators$] - receives istring$ on pinno 
ON PS2 interrupt - triggers an interrupt whenever the PicoMite sees a message from the PS2 interface.
OPTION HEARTBEAT ON/OFF
LINE  AA x1, y1, x2, y2 [, LW [, C]] - Draws a line with anti-aliasing.
FRAMEBUFFER - see manuals for details
OPTION SERIAL CONSOLE TXpin, RXpin [,B] - adding the "B" parameter means output will go to "B"oth the serial port and the USB 
PIO READ - Allows a single integer variable to be used when nbr=1

New/changed Functions - both versions
MATH(RAND) - returns a random number 0.0 <= n < 1.0 using the "Mersenne Twister: A 623-dimensionally
MM.INFO(drive) - get the current active drive - returns A: or B:
MM.INFO(HEAP) - returns the free space on the MMBasic heap
MM.INFO(STACK) - returns the C program stack pointer
MM.INFO$(SOUND) - returns the status of the audio channel
MM.INFO(PS2) - returns the last raw PS2 message received. 
MM.INFO(PINNO n) now accepts a literal, a string variable or an unquoted GPn designation
MATH(CRC8 array()_or_string$, [length,] [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] - calculate an 8 bit CRC
MATH(CRC12 array()_or_string$, [length,] [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] - calculate a 12 bit CRC
MATH(CRC16 array()_or_string$, [length,] [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] - calculate a 16 bit CRC
MATH(CRC32 array()_or_string$, [length,] [polynome,] [startmask,] [endmask,] [reverseIn,] [reverseOut] - calculate a 32 bit CRC
PIO(EXECCTRL jmp_pin ,wrap_target, wrap [,side_pindir] [,side_en]) - JMP PIN must have GP designation, Extra optional parameters

Other new functionality -PicoMite
Enabled BLIT and LOAD JPG for mono displays
BLIT LOAD: now also accept BLIT LOADBMP for compatibility with VGA version
Adds support for the 480x320 IPS ILI9481 display (use code ILI9481IPS)
Implementation of sprite command and function

Other new functionality -PicoMiteVGA
Use EDIT 1 to edit in mode 1, Use EDIT 2 to edit in mode 2, Use EDIT to edit in current mode
Implements DRAW3D command and function (VGA version only)
Improved LOAD JPG for MODE 1 (mono). 


Bug Fixes and corrections - both versions
Fixes crashing bug if edit is used after running a program with IR input
Fixes bug in BITBANG LCD CMD and BITBANG LCD DATA
Fixes bug in PIO READ
Fixed bug in sound command overdriving the PWM when > 2 channels are used and the volume isn't explicitly specified
Fixed bug in PWM n,OFF requiring spurious extra parameter
Fixes bug in SDK that caused SPI clock to set to wrong level before first transaction
Fixes bug when using "ON KEY int" command
Fixes bug in passing string function to time$
Fixes bug in MM.INFO(filesize ... and MM.INFO(Modified ...
Changes to PS2 keyboard handler to fix bug where interrupts are dropped
Fixes bug in PLAY TONE n. m. d, interrupt which caused the interrupt not to fire
Fixes bug in ERASE command when erasing arrays
Improved error checking of SETPIN command to avoid crashes
Fix to BITBANG WS2812 timings
Improved error messaging for incorrect pin usage. 
Fixed MM.INFO(pinno whe OPTION EXPLICIT specified.
Improved error detection on some option commands to avoid lockups through pin conflicts
Fixes bug in setpin fin,per,cin when fast signal is established before the setpin

Bug Fixes and corrections - PicoMite
Fixes bug in GUI DELETE
Fixes bug in OPTION LIST for some displays
SPI for touch reduced in speed to 1MHz to improve reliability
Bug fix to GUI spinbox to erase triangle bounding line properly
Fixed bug in LOAD IMAGE for mono displays
Corrects reporting of MM.HRES and MM.VRES by OPTION LIST when a user driver is loaded

Bug Fixes and corrections - PicoMiteVGA
Fixes issue where connecting a USB CDC cable would cause the VGA version to Hardfault
Change timing of PAGE COPY ,,B to avoid screen artefacts
Fixes issue on some Pico in VGA mode 1 output at 126MHz

=================================================================================
PicoMite V5.07.04 Changes from V5.07.03

Bug Fixes and functional corrections
Fixes bug where the system would lock up on booting if OPTION RTC AUTO was enabled but the RTC was missing. 
Now a warning will be printed and the option disabled. 
Fixes bug in MM.INFO(FILESIZE and MM.INFO(MODIFIED
Fixes an interaction between setpin FIN/PIN/CIN and PS2 keyboard usage
Fixes an interaction between interrupts and error messages
Fixes bug in ADC START command when more than 2 channels are specified and it is used in blocking mode
Fixes bug in datetime$
fixes bug in play wav command skipping a small amount of output at the beginning of playing 
Fixes bug that caused  tempr function to give pin reserved error under certain circumstances
Fixes PS2 keyboard dropping characters under certain circumstances
Changes to onewire timings to match CMM2

General changes
Forces an option reset and clear flash if swapping between PicoMite and PicoMiteVGA firmware
Implements READ SAVE and READ RESTORE
These allow a subrountine to read its own data whilst preserving the data pointers for the main program
Implements EXECUTE command
Enables pins that are not exposed on the Pico to be used for reserved functions (e.g.SYSTEM I2C) 

VGA version changes
Major re-write of the VGA driver to allow selection of foreground and backgound colours in 640x480 mode.
The colours can be set for the whole screen or individually for 16x16 pixel tiles
Huge performance improvements
GETSCANLINE function implemented
Allows programmable switching between mode 1 (640x480) and mode 2 (320x240)
Use OPTION DEFAULT MODE 1 to boot in 640x480 mode
Use OPTION DEFAULT MODE 2 to boot in 320x240 mode
Use OPTION LCDPANEL CONSOLE n to set the default font to n
To switch modes in a program use the new MODE command
MODE 1 sets to 640x480
MODE 2 sets to 320x240
There is a new command TILE that can be used to set the foreground and background color of each 16x16 area in mode 1 (640x480)
TILE x, y [,foregroundcolour]  [,backgroundcolour] [,no_tiles_wide] [,no_tiles_high]
This command is ignored in mode 2

=================================================================================
PicoMite V5.07.03 Changes from V5.07.01

When first loaded this version will force a complete flash wipe removing all options, saved variables, and any prorams stored in flash

General changes
PicoMiteVGA introduced - see manual for details
Program now runs from flash memory freeing up much more memory
Maximum program size now 124Kbytes (108 for VGA version
Flash slots reduced from 10 to 7 (8 for VGA version).
FLASH RUN and FLASH CHAIN now execute direct from the specified flash slot without changing the main program
Support for a PS2 Keyboard added
Significant performance tuning
Improved USB console receive
Increased the maximum display width in OPTION DISPLAY to 240 characters
Enables F1 as a user programmable function key
Implements support for SSD1963 parallel displays
Support for 240x240 round GC9A01 display
Reduces maximum file name length to 63 characters but increase maximum files that can be listed with FILES command to 1000
Increases drive level for SDcard output pins (CD, MOSI and CLOCK)
New font added FONT 8 is a very small 6x4 font useful for 320x240 screens
OPTION MEMORY removed as no longer relevant
OPTION BAUDRATE n now sets the baudrate for when a serial console is used
AUTOSAVE can now be terminated by entering Control-Z  or F1 which will then cause the received data to be transferred into program memory 
overwriting the previous program. Use F2 to exit and immediately run the program.
Reading from the framebuffer now available and bug fixed on SSD1963, ILI9341, ST7789_320 and ILI9488
This enables the following on these displays:
PIXEL(x,y) function
SAVE IMAGE command
Transparent text
BLIT


Bug Fixes and functional corrections
Various bug fixes to CSUB code, new header files for CSubs
Fixes bug in ON KEY keyno,int
Fixed memory leak caused by ctrl-C out of FILES command 
Fixes bug in loading F6-F9 user function definitions
Fixed bug in PWM timings
Fixes a bug where LINE INPUT would not read the last line in a file if it was not terminated with a CR
Fixes bug in cursor positioning in editor
Fixed bug error message when an invalid flash page is selected
Fixes bug in day$(now) function
Fixes bug where writing text to an SPI LCD that overlapped the bottom of the screen would fail to de-assert LCD_CS
Fixes bug that added an extra space after a REM command each time the program was edited.
Fixes bug in BACKLIGHT 0
Fixes bug in using SYSTEM I2C or I2C2 for general I2C use if I2C READ does not use a string as the variable. 
Fixes bug in COM1 where buffer overrun is losing characters.
Tidied up system response when OPTION LCDPANEL has an error
Change to DIR$() function to allow use with a single parameter as specified in the manual
Changes to FILE command to properly deal with relative paths from a sub-directory


New or enhanced commands and functions
LOAD JPG fname$ [,xleft%] [,ytop%]
FORMAT$()
FLUSH [#]filenumber
INTERRUPT [myint]
OPTION KEYBOARD nn [,capslock] [,numlock] [repeatstart] [repeatrate]
PRINT @(x, y [,mode])
OPTION LCDPANEL CONSOLE [font] [,foregroundcolour] [backgroundcolour] [backlight]
OPTION LCDPANEL NOCONSOLE
POKE DISPLAY command [,data1] [,data2] [,datan]
SETPIN pinno,CIN [,change]
SETTICK PAUSE, myint [,tickno] 
SETTICK RESUME, myint [,tickno] 
FLASH LIST no [,all]
FILES [fspec$] [, sort]
POKE DISPLAY HRES n
POKE DISPLAY VRES m



=================================================================================
PicoMite V5.07.01 Changes from V5.07.00

You should load CLear_Flash.uf2 before loading this firmware if upgrading from V5.07.00 or from a beta version of V5.07.01 before b5

Fixed Bug in epoch function which changed date$. 
Changed maximum WS2812 LEDs to 256
MM.INFO(pinno GPnn) implemented to give physical pin number for a given GP number


Improvement to terminal serial output used by command stacking
Implements a logarithmic scale for the volume control so that PLAY VOLUME 50,50 should sound half as loud as 100,100
Also applies to PLAY SOUND n, ch, type, freq [,vol]


Fixes bug in SETPIN pinno,IR
Fixes bug in parameters following subcommands/sub-functions that are enclosed in brackets e.g. POKE WORD (anything),anything or ? PEEK(WORD (anything))
Allows variables or string literals in the SOUND command for both the channel and sound type. The original syntax is still also allowed


Implements the option of using a standard uart as the console
OPTION SERIAL CONSOLE uartapin, uartbpin
uartapin and uartbpin can be any valid pair of rx and tx pins for either com1 (uart0) or com2( uart1). The order you specify them is not important
Use:
OPTION SERIAL CONSOLE DISABLE
to revert to normal the USB console


Re-compile and build under pico-sdk V1.3

Fixes bug in GPS receipt where the first read of GPS(DATE) may give an incorrect answer.
Fixes bug in reporting the line of an error when goto/gosub to a line number is used. 
Fixes bug where OPTION SERIAL CONSOLE DISABLE doesn't work after reboot

Implements LIST ALL fname$
Fixes bug in GUI SWITCH
Restores original program if AUTOSAVE is terminated with Ctrl-C or XMODEM R terminates with an error


Clears variable memory after Ctrl-C out of Autosave
Removes creation of spurious "Reset" USB device


Further rework of GUI SWITCH. 
Rename FileIO.c for Linux. 
AUTOSAVE "file" now reports a "Syntax Error" rather than "Unknown command". 
EDIT "file" reporting an error rather than just ignoring the argument.

OPTION AUDIO now forces reset to avoid user confusion